package com.joysuch.wwyt.workflow.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author xsx
 * @version 1.0
 * @date 2022/9/15 13:37
 */
public enum WorkFlowFiledTypeEnum {
    select("select","下拉选择器"),
    ueditor("ueditor","富文本"),
    input("input","单行文本"),
    textarea("textarea","多行文本"),
    number("number","计数器"),
    map("map","地图选择器"),
    radio("radio","单选框"),
    checkbox("checkbox","多选框"),
    cascader("cascader","级联选择器"),
    tree("tree","树形选择器"),
    datetime("datetime","日期时间范围"),
    icon("icon","图标"),
    dynamic("dynamic","表格"),
    group("group","模块"),
    target("target","目标选择器"),
    blankfill("blankfill","填空文本"),
    signature("signature","签字"),
    video("video","视频"),
    monitorpoint("monitorpoint","监测点"),
    relationprocess("relationprocess","关联其它流程"),
    title("title","标签"),
    targets("targets","多个选择目标"),
    upload("upload","附件");


    private String type;
    private String name;

    WorkFlowFiledTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }
    private static final Map<String, WorkFlowFiledTypeEnum> lookup = new HashMap<>();

    static {
        for (WorkFlowFiledTypeEnum e : EnumSet.allOf(WorkFlowFiledTypeEnum.class)) {
            lookup.put(e.type, e);
        }
    }

    public static WorkFlowFiledTypeEnum find(String value) {
        return lookup.get(value);
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }
}
